/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-09-11
 * Time: 14:17
 */
class SingletonLazy1 {
    private static volatile SingletonLazy1 instance = null;
    private static SingletonLazy1 locker = new SingletonLazy1();
    public static SingletonLazy1 getInstance() {
        if (instance == null) {
            synchronized(locker) {
                if (instance == null) {
                    instance = new SingletonLazy1();
                }
            }
        }
        return instance;
    }
    private SingletonLazy1() {}

}
public class practice {
    public static void main(String[] args) {
        SingletonLazy1 s1 = SingletonLazy1.getInstance();
        SingletonLazy1 s2 = SingletonLazy1.getInstance();

        System.out.println(s1 == s2);

    }
}
